package com.fruit.utils;

import java.util.List;
import java.lang.reflect.Method;  
import java.util.Arrays; 

import net.sf.cglib.beans.BeanCopier;


import com.fruit.service.IDeliveryService;
import com.fruit.web.bo.impl.Consignee;
import com.fruit.web.bo.impl.Delivery;
import com.fruit.web.bo.impl.Order;
import com.fruit.web.constant.EjdConstants;
import com.fruit.web.constant.ManageBeanConstants;
import com.fruit.web.constant.SpringBeanConstants;
import com.fruit.web.vo.common.ConsigneeVo;
import com.fruit.web.vo.common.LocalBean;
import com.fruit.web.vo.common.OrderVo;


public final class BeanCopyUtil {
	public BeanCopyUtil() {
	  }
	public static void OrderCopyToOrderVo(Order order, OrderVo orderVo) {
		if (null != order && null != orderVo) {
			orderVo.setId(order.getId());
			orderVo.setOrderId(order.getOrderId());
			orderVo.setStatus(order.getStatus());
			orderVo.setConsigneeId(order.getConsigneeId());
			orderVo.setConsigneeName(order.getConsigneeName());
			orderVo.setConsigneeMobile(order.getConsigneeMobile());
			orderVo.setConsigneePhone(order.getConsigneePhone());
			orderVo.setConsigneeFax(order.getConsigneeFax());
			orderVo.setConsigneeZip(order.getConsigneeZip());
			orderVo.setConsigneeProvince(order.getConsigneeProvince());
			orderVo.setConsigneeCity(order.getConsigneeCity());
			orderVo.setConsigneeCounty(order.getConsigneeCounty());
			orderVo.setConsigneeAddress(order.getConsigneeAddress());
			orderVo.setDeliveryId(order.getDeliveryId());
			orderVo.setDeliveryName(order.getDeliveryName());
			orderVo.setDeliveryExpense(order.getDeliveryExpense());
			orderVo.setDeliveryDescription(order.getDeliveryDescription());
			orderVo.setPaymentType(order.getPaymentType());
			orderVo.setPaymentTypeDisplay(order.getPaymentTypeDisplay());
			orderVo.setPaymentId(order.getPaymentId());
			orderVo.setPaymentName(order.getPaymentName());
			orderVo.setPaymentExpense(order.getPaymentExpense());
			orderVo.setPaymentDescription(order.getPaymentDescription());
			orderVo.setPaymentTypeId(order.getPaymentTypeId());
			orderVo.setInvoiceType(order.getInvoiceType());
			orderVo.setInvoiceTypeDisplay(order.getInvoiceTypeDisplay());
			orderVo.setInvoiceTitle(order.getInvoiceTitle());
			orderVo.setInvoiceCompanyName(order.getInvoiceCompanyName());
			orderVo.setInvoiceCompanyAddress(order.getInvoiceCompanyAddress());
			orderVo.setInvoiceCompanyPhone(order.getInvoiceCompanyPhone());
			orderVo.setTaxAccount(order.getTaxAccount());
			orderVo.setBankName(order.getBankName());
			orderVo.setAccountNumber(order.getAccountNumber());
			orderVo.setInvoicePostAddress(order.getInvoicePostAddress());
			orderVo.setConvenientReceive(order.getConvenientReceive());
			orderVo.setRemark(order.getRemark());
			orderVo.setOrderGenerateTime(DateTimeUtil.getCurrentTimestamp());
			orderVo.setCouponAccount(order.getCouponAccount());
			orderVo.setCouponScore(order.getCouponScore());
			orderVo.setIntegrationScore(order.getIntegrationScore());
			orderVo.setTotallPrice(order.getTotallPrice());
			orderVo.setNeedPayment(order.getNeedPayment());
			
		}
	}
	
	public static void OrderVoCopyToOrder(OrderVo orderVo, Order order) {
		if (null != order && null != orderVo) {
			order.setId(orderVo.getId());
			order.setOrderId(orderVo.getOrderId());
			order.setStatus(orderVo.getStatus());
			order.setConsigneeId(orderVo.getConsigneeId());
			order.setConsigneeName(orderVo.getConsigneeName());
			order.setConsigneeMobile(orderVo.getConsigneeMobile());
			order.setConsigneePhone(orderVo.getConsigneePhone());
			order.setConsigneeFax(orderVo.getConsigneeFax());
			order.setConsigneeZip(orderVo.getConsigneeZip());
			order.setConsigneeProvince(orderVo.getConsigneeProvince());
			order.setConsigneeCity(orderVo.getConsigneeCity());
			order.setConsigneeCounty(orderVo.getConsigneeCounty());
			order.setConsigneeAddress(orderVo.getConsigneeAddress());
			order.setDeliveryId(orderVo.getDeliveryId());
			order.setDeliveryName(orderVo.getDeliveryName());
			order.setDeliveryExpense(orderVo.getDeliveryExpense());
			order.setDeliveryDescription(orderVo.getDeliveryDescription());
			order.setPaymentType(orderVo.getPaymentType());
			order.setPaymentTypeDisplay(orderVo.getPaymentTypeDisplay());
			order.setPaymentId(orderVo.getPaymentId());
			order.setPaymentName(orderVo.getPaymentName());
			order.setPaymentExpense(orderVo.getPaymentExpense());
			order.setPaymentDescription(orderVo.getPaymentDescription());
			order.setPaymentTypeId(orderVo.getPaymentTypeId());
			order.setInvoiceType(orderVo.getInvoiceType());
			order.setInvoiceTypeDisplay(orderVo.getInvoiceTypeDisplay());
			order.setInvoiceTitle(orderVo.getInvoiceTitle());
			order.setInvoiceCompanyName(orderVo.getInvoiceCompanyName());
			order.setInvoiceCompanyAddress(orderVo.getInvoiceCompanyAddress());
			order.setInvoiceCompanyPhone(orderVo.getInvoiceCompanyPhone());
			order.setTaxAccount(orderVo.getTaxAccount());
			order.setBankName(orderVo.getBankName());
			order.setAccountNumber(orderVo.getAccountNumber());
			order.setInvoicePostAddress(orderVo.getInvoicePostAddress());
			order.setConvenientReceive(orderVo.getConvenientReceive());
			order.setRemark(orderVo.getRemark());
			order.setOrderGenerateTime(DateTimeUtil.getCurrentTimestamp());
			order.setCouponAccount(orderVo.getCouponAccount());
			order.setCouponScore(orderVo.getCouponScore());
			order.setIntegrationScore(orderVo.getIntegrationScore());
			order.setTotallPrice(orderVo.getTotallPrice());
			order.setNeedPayment(orderVo.getNeedPayment());
		}
	}
}
